package com.tinem.platform.web.auth.server.client.password;

import com.tinem.platform.module.commons.util.PasswordUtil;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className GlpPasswordEncoder
 * @description TODO
 * @site 
 * @company 
 * @create 2020-08-26 14:22
 */
public class PlatformPasswordEncoder extends BCryptPasswordEncoder {

    @Override
    public String encode(CharSequence rawPassword) {
        return PasswordUtil.encode(rawPassword);
    }

    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        return encode(rawPassword).equals(encodedPassword);
    }
}
